package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * @author 木叶丸
 * @date 2018/8/19 21:33
 */
@Getter
public enum ChannelLevel {

    /**
     * 渠道级别
     */
    LEVEL_A("A级渠道", "2450720"),
    LEVEL_B("B级渠道", "2450721"),
    LEVEL_C("C级渠道", "2450722"),
    LEVEL_D("D级渠道", "3100435"),
    OTHER("未定级渠道", "");

    private String levelName;

    private String levelCode;

    ChannelLevel(String levelName, String levelCode) {
        this.levelName = levelName;
        this.levelCode = levelCode;
    }

    public static ChannelLevel getEnumByLevelName(String levelName) {
        for (ChannelLevel item : ChannelLevel.values()) {
            if (item.getLevelName().equals(levelName)) {
                return item;
            }
        }
        return OTHER;
    }

    public static ChannelLevel getEnumByLevelCode(String levelCode) {
        for (ChannelLevel item : ChannelLevel.values()) {
            if (item.getLevelCode().equals(levelCode)) {
                return item;
            }
        }
        return OTHER;
    }

}
